package com.peace.hospital.opdept.mapper.common;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.peace.hospital.entity.common.Staffinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 医院员工信息表 Mapper 接口
 * </p>
 *
 * @author 谢晓峰
 * @since 2019-11-11
 */
@Mapper
public interface StaffinfoMapper extends BaseMapper<Staffinfo> {
    /**通过用户名查询员工信息*/
    @Select("select * from hospital_public.staffinfo where staname=#{adminName}")
    Staffinfo selectStaffinfoByUserName(String adminName);
    /**通过科室id查询医生信息*/
    @Select("select staid from hospital_public.staffinfo where depid=#{depid} order by surplusnum DESC LIMIT 1")
    Staffinfo selectDoctorBydeptId(Integer depid);
}
